
cc.Class({
    extends: cc.Component,

    properties: {

    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        G.winMgr = this;
    },


    // showLoginLayer(){
    //     let nd = cc.instantiate(G.pfRes.pf_login);
    //     nd.setParent(this.node);
    // },

    showRegistLayer(){
        let nd = cc.instantiate(G.pfRes.pf_regist);
        nd.setParent(this.node);
    },

    // showAllItemLayer(data){
    //     let nd = cc.instantiate(G.pfRes.pf_allItem);
    //     nd.setParent(this.node);
    //
    //     let allItem = nd.getComponent('allItem');
    //     allItem.initWithAllData(data);
    // },

    showDetailLayer(itemData){
        let nd = cc.instantiate(G.pfRes.pf_detail);
        nd.setParent(this.node);

        let detail = nd.getComponent('detail');
        detail.initWithItemData(itemData);
    },

    showDeleteDialog(itemData){
        let nd = cc.instantiate(G.pfRes.pf_deleteDialog);
        nd.setParent(this.node);

        let deleteDialog = nd.getComponent('deleteDialog');
        deleteDialog.init(itemData);
    },

    showAddLayer(){
        let nd = cc.instantiate(G.pfRes.pf_addLayer);
        nd.setParent(this.node);
    },

    closeAllPopLayer(){
        this.node.destroyAllChildren();
    },
});
